import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ParkHistoricalLeaseVO, ParkHistoricalLeaseForm, ParkHistoricalLeaseQuery } from '@/api/zichanguanli/parkHistoricalLease/types';

/**
 * 查询园区历史租赁列表
 * @param query
 * @returns {*}
 */

export const listParkHistoricalLease = (query?: ParkHistoricalLeaseQuery): AxiosPromise<ParkHistoricalLeaseVO[]> => {
  return request({
    url: '/zichanguanli/parkHistoricalLease/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询园区历史租赁详细
 * @param id
 */
export const getParkHistoricalLease = (id: string | number): AxiosPromise<ParkHistoricalLeaseVO> => {
  return request({
    url: '/zichanguanli/parkHistoricalLease/' + id,
    method: 'get'
  });
};

/**
 * 新增园区历史租赁
 * @param data
 */
export const addParkHistoricalLease = (data: ParkHistoricalLeaseForm) => {
  return request({
    url: '/zichanguanli/parkHistoricalLease',
    method: 'post',
    data: data
  });
};

/**
 * 修改园区历史租赁
 * @param data
 */
export const updateParkHistoricalLease = (data: ParkHistoricalLeaseForm) => {
  return request({
    url: '/zichanguanli/parkHistoricalLease',
    method: 'put',
    data: data
  });
};

/**
 * 删除园区历史租赁
 * @param id
 */
export const delParkHistoricalLease = (id: string | number | Array<string | number>) => {
  return request({
    url: '/zichanguanli/parkHistoricalLease/' + id,
    method: 'delete'
  });
};
